fix: git issues list --repo silently accepts malformed repo filters and exact-matches untrimmed input - #1062
Closed
Martin-Blau wants to merge 1 commit into
Closed
fix: git issues list --repo silently accepts malformed repo filters and exact-matches untrimmed input#1062Martin-Blau wants to merge 1 commit into
Martin-Blau wants to merge 1 commit into
Conversation
Author
Contributor
|
@John-pillo1124 Be patience, maintainers will check it on time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
gitt issues list --reposo repository filters are normalized and validated before filtering issues.Merged PR #910 added
--repo <owner/name>, but the implementation compared raw user input directly againstrepository_full_name. That caused valid filters with surrounding whitespace to return no results, and malformed filters to be silently accepted.Related Issue
Fixes: #1061
Real Behavior Proof
Before this change,
gittensor/cli/issue_commands/view.pyfiltered with the raw CLI value:So this valid input failed to match:
gitt issues list --repo " owner/repo "And malformed inputs were accepted as filters:
Solution
issues_listnow reuses the existing repository validator:This makes
--repobehavior consistent with other issue commands.Updated Behavior
Whitespace-padded valid filters are normalized:
gitt issues list --repo " owner/repo "now behaves like:
Malformed filters now fail before contract reads with a bad parameter error.
Validation Notes
Added tests for:
--repo " owner/repo "in JSON mode--repo " owner/repo "in human table mode--repo ownerrepo--repo owner//repobad_parameterresponse shapeLocal checks run:
Both passed.
Full pytest could not be run in this environment because
pytest,uv, andpipare not installed.